﻿<!-- <template>
  <DocumentEditor id="docEditor" 
  documentServerUrl="https://hjg.onlyoffice.com/" 
  :config="config"
  :events_onDocumentReady="onDocumentReady" 
  :onLoadComponentError="onLoadComponentError" />
</template>


<script lang="ts" setup="" >
import { defineComponent } from 'vue';
import { DocumentEditor } from "@onlyoffice/document-editor-vue";


const config = {
  document: {
    fileType: "docx",
    key: "Khirz6zTPdfd7",
    title: "Example Document Title.docx",
    url: "https://api.hdwuyou.cn/11.docx"
  },
  documentType: "word",
  editorConfig: {
    callbackUrl: "https://api.hdwuyou.cn"
  }
}


const onDocumentReady = () => {
  console.log("Document is loaded");
}

const onLoadComponentError = (errorCode: any, errorDescription: any) => {
  switch (errorCode) {
    case -1: // Unknown error loading component
      console.log(errorDescription);
      break;

    case -2: // Error load DocsAPI from http://documentserver/
      console.log(errorDescription);
      break;

    case -3: // DocsAPI is not defined
      console.log(errorDescription);
      break;
  }
}
</script>
  -->



<!-- 
<template>
  <div>
    <OnlyOffice 
      ref="onlyOffice"
      mode="editor"
      baseUrl="https://hjg.onlyoffice.com"
      width="100%" 
      height="50%"
      documentId="770372"
      requestToken="cGV6Z21wUEZxNHlVMjdlOFBwb1N1cDZHUEI5YjRDSlUrZ3YrSElJdHlpYz0_IjRkMGY5ZTQ0LWZmM2QtNDViZS05MzNmLTc0YTU4ODAyYmM1ZiI"
    ></OnlyOffice>

       <OnlyOffice 
        ref="onlyOffice2"
        baseUrl="https://hjg.onlyoffice.com"
        width="100%" 
        height="400px"
        documentId="770372"
       requestToken="cGV6Z21wUEZxNHlVMjdlOFBwb1N1cDZHUEI5YjRDSlUrZ3YrSElJdHlpYz0_IjRkMGY5ZTQ0LWZmM2QtNDViZS05MzNmLTc0YTU4ODAyYmM1ZiI"
      ></OnlyOffice> 
  </div>
</template>

<script lang="ts" setup="">
import OnlyOffice from '/@/components/OnlyOffice/index.vue';
import { ref ,reactive,onMounted} from "vue";
const resData = ref({
  documentId:"770372",
  requestToken: "cGV6Z21wUEZxNHlVMjdlOFBwb1N1cDZHUEI5YjRDSlUrZ3YrSElJdHlpYz0_IjRkMGY5ZTQ0LWZmM2QtNDViZS05MzNmLTc0YTU4ODAyYmM1ZiI",
});
</script>

<style scoped>
</style> -->

<template>
  <iframe :src="externalUrl" frameborder="0" height="100%"></iframe>
</template>
<script lang="ts" setup="">
  import { ref } from 'vue';
  const externalUrl = ref('https://shimo.im/sheets/RKAWMeMQ72F14Yq8'); // 替换为实际的外部网址
</script>
